1. Field of the Invention
The present invention relates to an encoding and decoding method and apparatus thereof for use in a system for transmitting and receiving a video signal, and more particularly to an encoding and decoding method and apparatus thereof for transmitting and receiving data effectively by adaptively processing the data of a frame/field pattern.
2. Description of the Prior Art
Generally, a method that the video data is processed by a differential pulse-code-modulation (DPCM) method and then transmitted, and the received DPCM data is restored, is chiefly used in a digital transmission and reception of a video signal. The DPCM method uses a very high correlation between the pictures of the video data, and encodes difference signals between the frames, thereby obtaining a high data compression ratio. Such a DPCM encoding and decoding method can be used in a high definition television, a digital video tape recorder, a teleconference system, etc.
FIG. 1 illustrates a conventional apparatus for encoding video data. In FIG. 1, video data V.sub.IN input in unit of a block having a predetermined magnitude is orthogonally transformed and .encoded by a discrete cosine transform (DCT) method in a DCT block 11. The transform coefficient data output from DCT block 11 is quantized by a predetermined quantization level in a quantizer 12. The quantized video data is variable-length-coded according to data distribution probability in a variable-length-coder 13. While the variable-length-coded video data passes through buffer 14, it is outputted as transmission data V.sub.CD having a predetermined speed. As described above, the whole frame is encoded by sequentially encoding the input block video data and this coding is called an intramode coding.
On the other hand, the quantized data outputted from quantizer 12 is supplied to an inverse quantizer 15 and is restored to a state prior to being quantized. The transform coefficient data by the inverse-quantization is inversely transformed in an inverse DCT block 16 by an inverse DCT method and restored to a state prior to being transformed by the DCT method. The video data outputted from inverse DCT block 16 is stored in turn in a frame memory 17 via a second adder 20. A motion predictor 18 receives the same video data as that input to a first adder 10, and detects a portion corresponding to the currently input block data among the data of the previous pictures stored in frame memory 17, thereby detecting a corresponding motion vector. The detected motion vector is supplied to motion compensator 19. Then, motion compensator 19 uses the motion vector and extracts the block data which is closest to the currently input block data among the data of the previous pictures stored in frame memory 17. Such block data outputted from motion compensator 19 is supplied to a first adder 10, which calculates the difference component from the currently input block data. The video data corresponding to the difference component is encoded and transmitted. As described above, a mode which encodes the difference signal between the current block data and the motion compensated block data is called intermode.
The video data which is encoded and transmitted as described above is input to a decoder of FIG. 2. Then, encoded video data V.sub.CD is decoded through an inverse procedure of the variable-length-coding method in a variable-length-decoder 22 via buffer 21. The data output from variable-length-decoder 22 is inversely quantized as a frequency band transform coefficient in an inverse quantizer 23. An inverse DCT block 24 transforms the frequency band transform coefficient supplied from inverse quantizer 23 into the video data of the spatial region. Here, the inversely transformed video data is reproduction error data corresponding to the error data which is calculated from first adder 10 in the encoder of FIG. 1.
Also, motion vector MV which is calculated and transmitted from motion predictor 18 of the encoder is similarly supplied to motion compensator 26. Motion compensator 26 reads the block data corresponding to motion vector MV from the frame data stored in frame memory 25 and supplies the read data to an adder 27. Then, the inversely transformed error data and the block data supplied from motion compensator 26 is combined in adder 27 and is supplied to a display (not shown).
The encoding procedure as shown in FIG. 1 is performed in unit of a macroblock or a slice having a predetermined magnitude, which is composed of a luminance signal Y and, color difference signals U and V, with respect to 8 blocks of a 8.times.8 pixel unit as shown in FIG. 3. Also, in such an encoding procedure, the DCPM method is performed with respect to direct current (DC) component data. The DC DCPM method is performed in unit of a macroblock or a slice. To perform the DC DCPM method in unit of a slice not only reduces the reset period but also an amount of the data, compared with the performance of the DC DCPM in unit of a macroblock. The DC DCPM method is preformed only in case that the encoding procedure is an intramode. Here, the intermode and the intramode are determined in unit of a macroblock or a slice.